<template>
  <div>
    请输入账号：<el-input v-model="username" placeholder="请输入账号"></el-input>
    请输入密码：<el-input v-model="userpwd" placeholder="请输入密码" show-password></el-input>
    <el-button type="success" @click="login">登录</el-button>
  </div>
</template>
<script>
export default {
  data() {
    return {
      username: '',
      userpwd:''
    }
  },
  methods: {
    login(){
      const {username,userpwd} = this
      let wantGo = this.$route.query.redirect
      let g = wantGo ? wantGo : '/'
      console.log(g)
      if(username == 'admin' && userpwd == '123'){
        sessionStorage.setItem('token','asduasdysiabhdsaiudsahda156161')
        sessionStorage.setItem('username', username)
        this.$router.push(g)
      }
    },
  },
};
</script>
<style scoped>
</style>